package com.sea.supply.service;



import com.sea.supply.entity.Buy;
import com.sea.supply.entity.Receive;
import org.apache.ibatis.annotations.Param;

import java.io.InputStream;
import java.util.List;

/**
 * @author 陈鸿飞
 */
public interface ReceiveService {
    /**
     * 新增收货记录
     * @param receive
     * @return
     */
    int save(Receive receive);

    /**
     * 导入收货SKU
     * @param inputStream
     * @param fileName
     * @return
     * @throws Exception
     */
    void importSku(InputStream inputStream, String fileName, String userRealName) throws Exception;
    /**
     * 查找指定
     * @param receive
     * @return
     */
    List<Receive> findByCnd(Receive receive);
    /**
     * 待收货列表
     * @param receive
     * @return
     */
    List<Receive> findByShipped(Receive receive);
    /**
     * 查询可分配数量
     * @param orderSku
     * @param orderChannelName
     * @return
     */
    Integer getDistributeNumber(String orderSku,String orderChannelName,String orderDate, String producePo);

    /**
     * 查询预占有可分配数量
     * @param orderSku
     * @param orderChannelName
     * @return
     */
    List<Receive> findByDistributeReadyUse(String orderSku, String orderChannelName,String orderDate,String supplierName,String produceNo);

    Receive findByWareProduce(String receiveSku,String receiveChannelName, String produceNo);

    List<Receive> findReceivePlanNo();

    Receive findByWareProducePrice(String receiveSku,String receiveChannelName,String produceNo);

    void receive(Receive receive,Integer produceId,String userRealName,double percent);

    void wareReceive(Receive receive,String userRealName,Integer produceId);

    List<Receive> findByPlanNo(String receivePlanNo);
}
